home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / term / extras / source / gtlayout-source.lha / LTP_SizeDimensions.c < prev    next >
C/C++ Source or Header  |  1995-03-31  |  1KB  |  82 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. ULONG __regargs
  10. LTP_GetSizeWidth(struct LayoutHandle *handle)
  11. {
  12.     Object    *SizeImage;
  13.     ULONG     SizeWidth;
  14.     UWORD     SizeType;
  15.  
  16.     if(handle -> Screen -> Flags & SCREENHIRES)
  17.     {
  18.         SizeWidth    = 18;
  19.         SizeType    = SYSISIZE_MEDRES;
  20.     }
  21.     else
  22.     {
  23.         SizeWidth    = 13;
  24.         SizeType    = SYSISIZE_LOWRES;
  25.     }
  26.  
  27.     if(SizeImage = NewObject(NULL,SYSICLASS,
  28.         SYSIA_Size,    SizeType,
  29.         SYSIA_Which,    SIZEIMAGE,
  30.         SYSIA_DrawInfo,    handle -> DrawInfo,
  31.     TAG_DONE))
  32.     {
  33.         GetAttr(IA_Width,SizeImage,&SizeWidth);
  34.  
  35.         DisposeObject(SizeImage);
  36.     }
  37.  
  38.     if(SizeWidth < handle -> Screen -> WBorRight)
  39.         return(handle -> Screen -> WBorRight);
  40.     else
  41.         return(SizeWidth);
  42. }
  43.  
  44.  
  45. /*****************************************************************************/
  46.  
  47.  
  48. ULONG __regargs
  49. LTP_GetSizeHeight(struct LayoutHandle *handle)
  50. {
  51.     Object    *SizeImage;
  52.     ULONG     SizeHeight;
  53.     UWORD     SizeType;
  54.  
  55.     if(handle -> Screen -> Flags & SCREENHIRES)
  56.     {
  57.         SizeHeight    = 10;
  58.         SizeType    = SYSISIZE_MEDRES;
  59.     }
  60.     else
  61.     {
  62.         SizeHeight    = 11;
  63.         SizeType    = SYSISIZE_LOWRES;
  64.     }
  65.  
  66.     if(SizeImage = NewObject(NULL,SYSICLASS,
  67.         SYSIA_Size,    SizeType,
  68.         SYSIA_Which,    SIZEIMAGE,
  69.         SYSIA_DrawInfo,    handle -> DrawInfo,
  70.     TAG_DONE))
  71.     {
  72.         GetAttr(IA_Height,SizeImage,&SizeHeight);
  73.  
  74.         DisposeObject(SizeImage);
  75.     }
  76.  
  77.     if(SizeHeight < handle -> Screen -> WBorBottom)
  78.         return(handle -> Screen -> WBorBottom);
  79.     else
  80.         return(SizeHeight);
  81. }
  82.